set exmh(slowDisp) [expr {$time > $exmh(slowDispLimit)}]
if $exmh(slowDisp) {
Exmh_Debug "Slow display: took $time microseconds to create test icon"
set exmh(slowDispShowFaces) [string match $exmh(slowDispFaces) {always}]
set exmh(slowDispColorIcon) [string match $exmh(slowDispIcons) {always}]
} else {
Exmh_Debug "Fast display: took $time microseconds to create test icon"
set exmh(slowDispShowFaces) [expr { ![string match $exmh(slowDispFaces) {never}] }]
set exmh(slowDispColorIcon) [expr { ![string match $exmh(slowDispIcons) {never}] }]
}
}
proc Faces_Init {} {
global faces
if {$faces(dir) == {}} {
set faces(enabled) 0
}
# faces(suffix) starts out (by default) with {xpm gif xbm}
if {![info exists faces(suffix)] || ([llength $faces(suffix)] == 0)} {
set faces(suffix) xbm
}
# Double check the non-standard pixmap image type to avoid file stat
if {[lsearch [image types] pixmap] < 0} {
set ix [lsearch $faces(suffix) xpm]
if {$ix >= 0} {
set faces(suffix) [lreplace $faces(suffix) $ix $ix]
}
}
Preferences_Add "Faces" \
"Exmh will display a bitmap or image of the person that sent the current message (or their organization). This relies on the faces/picon database, or the presence of an X-Face: mail header.
Any given mail address can match a range of face images, from most specific (such as an X-Face) or most general (such as an a default image for a toplevel domain)." {
{faces(xFaceEnabled) xFaceEnabled ON {Use X-Face headers}
"If a message contains an X-Face header, display the image encoded into the header."}
{faces(xfaceProg) xfaceProg {} {X-Face command}
"A command to convert an X-Face: header line into a displayable X11 bitmap.
If you've patch uncompface, this can be: uncompface -X
otherwise you should use this: uncompface | ikon2xbm
Defining this enables the display of X-Face images. This is independent of the facesaver database."}
{faces(enabled) facesEnabled ON {Use faces database}
"Search for and display images from the facesaver database."}
{faces(rowEnabled) facesRow OFF {Use faces row}
"Use a horizontal row to display all the matching images of a face, rather than the most specific one."}
{faces(xImageUrl) xImageUrl ON {Use X-Image-URL}
"If a message contains an X-Image-URL header, display the image referenced in that header."}
{faces(defer) facesDefer ON {Background processing}
"When on, this causes faces display to be handled as a background task. This allows the display of a faces row to be aborted when another message is selected. If your machine can display faces quickly enough, you should turn this off."}
{faces(palette) facesPalette {} {Size of color palette}
"This allows you to force exmh to render face images in a less color-consuming
manner. Valid settings are as for the -palatte option of the Image Photo widget.
With the default setting, an empty string, images are rendered in as large a color cube as the photo widget can allocate.
When set to a single decimal number, this specifies the number of shades of gray to use. A value of 2 results in a dithered monochrome; 32 results in a pleasing greyscale.
When set to three decimal numbers separated by slashes (/), specifying the number of shades of red, green and blue to use, respectively. 5/5/4 is a useful setting for an 8-bit Pseudocolor display"}